Ext.define('cfWeb.store.appAudit.AppAuditStore', {
    extend: 'Ext.data.Store',
    alias: 'widget.appAuditStore',

    autoLoad: true,
    autoSync: true,
    fields: [
        {name: 'id', type: 'string'},
        {name: 'org', type: 'string'},
        {name: 'space', type: 'string'},
        {name: 'templateId', type: 'string'},
        {name: 'memory', type: 'string'},
        {name: 'instance', type: 'int'},
        {name: 'userName', type: 'string'},
        {name: 'state',type:'int'},
        {
            name: 'date', type: 'string', convert: function (v) {
            var now = new Date(v);
            return now.toLocaleDateString();
        }
        },
        {name: 'reason', type: 'string'}
    ],
    groupField: 'state',
    proxy: {
        type: 'rest',
        url: 'rest/audit/listall',
        reader: {
            type: 'json',
            root: 'data',
            successProperty : 'success'
        }
    }
});
